package com.ushine.mybatisplus.emp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ushine.mybatisplus.emp.model.Emp;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public interface EmpMapper extends BaseMapper<Emp> {

    void insertByXml(Emp emp);

    @Insert("insert into t_emp(name,salary,entry_time,dept_id) values(#{name},#{salary},#{entryTime},#{deptId})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void insetByAnnotation(Emp emp);

    IPage<Emp> listPageEmpByXml(IPage<Emp> page,Emp emp);

    IPage<Emp> lisPageEmpDeptByXml(IPage<Emp> page, Map<String,Object> map);

    IPage<Emp> listPageEmpDeptStepByXml(IPage<Emp> page,Emp emp);


}
